package com.wavehi.mapper;

import com.wavehi.domain.FileCustom;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Description
 * @Author WaveHi
 * @Date 26/12/2021 下午 4:44
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 */
@Mapper
public interface FileCustomMapper {
    @Select("select * from t_file_custom where backedUp = 0")
    List<FileCustom> selectAll();
    @Update("update t_file_custom set backedUp = #{state} where id = #{id}")
    int changeState(@Param("id") Long id, @Param("state")int state);

    @Select("select * from t_file_custom where backedUp = 0 limit 0,#{size}")
    List<FileCustom> fetchData(int size);

    @Select("select * from t_file_custom where type = #{type} and backedUp = 0")
    List<FileCustom> selectByType(String type);
}
